<?php
// Connexion validée
if ($statut == "valide") {
?>

    <h2>Connexion réussie</h2>
    <p>Vous êtes maintenant connecté sur Campus Exchange !</p>
    <meta http-equiv="refresh" content="3;URL=../Accueil">

<?php
// Connexion non validée
} else {
    
    if ($statut == "erreur"): ?>
    
        <h2>Erreur</h2>
        <p>Vous n'avez pas été connecté. Veuillez vérifier les points suivants:</p>
        <ul>
            <?php foreach ($liste_erreurs as $key => $value): ?>
                <li><?= $key ?> => <?= $value ?></li>
            <?php endforeach; ?>
        </ul>
            
    <?php endif; ?>
  
    <form method="POST" action="">
    <input type="hidden" name="submited" value="true" />
    <div class="cfg-contactform" id="cfg-contactform-4">
        <div class="cfg-contactform-content">

            <div class="cfg-element-container">
                <div class="cfg-element-set" id="cfg-element-4-9-set" >
                    <div class="cfg-element-content">
                        <span class="cfg-title "  name="titre" id="cfg-element-4-9">Connexion</span>
                    </div>
                </div>
            </div>

            <div class="cfg-element-container">
                <label class="cfg-label" id="cfg-element-4-25-label" ><span class="cfg-label-value">Email étudiant :</span></label>

                <div class="cfg-element-set" id="cfg-element-4-25-set" >
                    <div class="cfg-element-content">
                        <input type="text" class="cfg-type-text cfg-form-value " name="mail_etu" id="cfg-element-4-25"  />
                    </div>
                </div>

                <div class="cfg-clear"></div>
            </div>

            <div class="cfg-element-container">
                <label class="cfg-label" id="cfg-element-4-28-label" ><span class="cfg-label-value">Mot de passe : </span></label>

                <div class="cfg-element-set" id="cfg-element-4-28-set" >
                    <div class="cfg-element-content">
                        <input type="password" class="cfg-type-text cfg-form-value " name="password1" id="cfg-element-4-28"  />
                    </div>
                </div>

                <div class="cfg-clear"></div>
            </div>

            <div class="cfg-element-container">
                <div class="cfg-element-set" id="cfg-element-4-30-set" >
                    <div class="cfg-element-content">
                        <input type="submit" class="cfg-submit " name="connexion" id="cfg-element-4-30" value="Connexion"   />
                    </div>
                </div>
            </div>

        </div><!-- cfg-contactform-content -->

    </div><!-- cfg-contactform -->

</form>
        
<?php
}
?>